package com.zhuiyun.pm.client.bidding.mapper;

import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.zhuiyun.pm.client.bidding.entity.ClientGoodsInfo;

import com.zhuiyun.pm.config.BaseMapper;
import org.apache.ibatis.annotations.*;

import javax.persistence.AssociationOverride;
import java.util.List;

@Mapper
public interface ClientMyBiddingMapper extends BaseMapper<ClientGoodsInfo> {

    @Select("select cg.*,mo.transaction_status as dd,mo.end_price  FROM client_goods_earnest_money mo \n" +
            "            JOIN client_goods_info cg\n" +
            "            on mo.goods_id = cg.id\n" +
            "            where mo.user_id = #{userId}" )
    @Results({

            @Result(property = "goodsNumber",column = "goods_number"),
            @Result(property = "goodsName",column = "goods_name"),
            @Result(property = "startPrice",column = "start_price"),
            @Result(property = "transactionAddress",column = "transaction_address"),
            @Result(property = "weight",column = "weight"),
            @Result(property = "number",column = "number"),
            @Result(property = "transactionType",column = "transaction_type"),
            @Result(property = "earnestMoney",column = "earnest_money"),
            @Result(property = "imgId",column = "img_id"),
            @Result(property = "transactionStatus",column = "transaction_status"),
            @Result(property = "startTime",column = "start_time"),
            @Result(property = "endPrice",column = "end_price"),
            @Result(property = "endTime",column = "end_time"),
            @Result(property = "delayMinutes",column = "delay_minutes"),
            @Result(property = "sellerId",column = "seller_id"),
            @Result(property = "checkStatus",column = "check_status"),
            @Result(property = "createTime",column = "create_time"),
            @Result(property = "updateTime",column = "update_time"),
            @Result(property = "back",column = "back"),
            @Result(property = "delFlag",column = "del_flag"),
            @Result(property = "phone",column = "phone"),
            @Result(property = "contactName",column = "contact_name"),
            @Result(property = "imgViewId",column = "img_view_id"),
            @Result(property = "transactionStatusdd",column = "dd"),
    })
    List<ClientGoodsInfo> listmy(@Param("userId") Integer userId);

}
